package com.hzvdvmc.autosale.sale.ui;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.InputFilter;
import android.text.method.DigitsKeyListener;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.hzvdvmc.autosale.R;

/**
 * Created by william on 2018/1/12.
 */

public class ComonTextDialog extends BaseDialog {

    private TextView tvTitle, tvContent;
    private Button btnCancel;
    private Button btnYes;

    public ComonTextDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    public ComonTextDialog(Context context) {
        this(context, R.style.MyDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_confirm);
        tvTitle = (TextView) findViewById(R.id.tv_title);
        tvContent = (TextView) findViewById(R.id.tv_content);
        btnCancel = (Button) findViewById(R.id.btn_cancel);
        btnYes = (Button) findViewById(R.id.btn_yes);

        btnCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }

    public void setTitle(String title) {
        tvTitle.setText(title);
    }

    public void setContent(String content) {
        tvContent.setText(content);
    }


    public void setOkOnClickListenter(View.OnClickListener onClickListenter) {
        btnYes.setOnClickListener(onClickListenter);
    }
}
